package designpattern.singleton;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
 * 
 * @author BaoLoc
 *
 */
public class TestSingleton extends JPanel implements ActionListener{
	JButton button;

	public static void main(String[] args) {
		JFrame jFrame = new JFrame();
		jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jFrame.setContentPane(new TestSingleton());
		jFrame.pack();
		jFrame.setLocation(700, 380);
		jFrame.setVisible(true);
		
	}
	public TestSingleton() {
		// TODO Auto-generated constructor stub
		setPreferredSize(new Dimension(200,50));
		JButton jButton = new JButton("Open");
		jButton.addActionListener(this);
		add(jButton);
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		Singleton.getInstance();
//		System.out.println(e.getActionCommand());
	}


}
